package cn.home.resident.service.impl;

import java.util.List;

import cn.home.resident.domain.HomeHealthlog;
import cn.home.resident.mapper.HomeHealthlogMapper;
import cn.home.resident.service.IHomeHealthlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 健康记录Service业务层处理
 * 
 * @author homedoctor
 * @date 2025-04-11
 */
@Service
public class HomeHealthlogServiceImpl implements IHomeHealthlogService
{
    @Autowired
    private HomeHealthlogMapper homeHealthlogMapper;

    /**
     * 查询健康记录
     * 
     * @param id 健康记录主键
     * @return 健康记录
     */
    @Override
    public HomeHealthlog selectHomeHealthlogById(Long id)
    {
        return homeHealthlogMapper.selectHomeHealthlogById(id);
    }

    /**
     * 查询健康记录列表
     * 
     * @param homeHealthlog 健康记录
     * @return 健康记录
     */
    @Override
    public List<HomeHealthlog> selectHomeHealthlogList(HomeHealthlog homeHealthlog)
    {
        return homeHealthlogMapper.selectHomeHealthlogList(homeHealthlog);
    }
    /**
     * 查询健康记录列表
     *
     * @param userid typeid
     * @return 健康记录
     * */
    @Override
    public List<HomeHealthlog> selectHomeHealthlogByUseridAndTypeid(Long userid, Long typeid) {
        return homeHealthlogMapper.selectHomeHealthlogByUseridAndTypeid(userid,typeid);
    }

    /**
     * 新增健康记录
     * 
     * @param homeHealthlog 健康记录
     * @return 结果
     */
    @Override
    public int insertHomeHealthlog(HomeHealthlog homeHealthlog)
    {
        return homeHealthlogMapper.insertHomeHealthlog(homeHealthlog);
    }

    /**
     * 修改健康记录
     * 
     * @param homeHealthlog 健康记录
     * @return 结果
     */
    @Override
    public int updateHomeHealthlog(HomeHealthlog homeHealthlog)
    {
        return homeHealthlogMapper.updateHomeHealthlog(homeHealthlog);
    }

    /**
     * 批量删除健康记录
     * 
     * @param ids 需要删除的健康记录主键
     * @return 结果
     */
    @Override
    public int deleteHomeHealthlogByIds(Long[] ids)
    {
        return homeHealthlogMapper.deleteHomeHealthlogByIds(ids);
    }

    /**
     * 删除健康记录信息
     * 
     * @param id 健康记录主键
     * @return 结果
     */
    @Override
    public int deleteHomeHealthlogById(Long id)
    {
        return homeHealthlogMapper.deleteHomeHealthlogById(id);
    }
}
